﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Contexts;
using System.Text;
using Model.BusinessLogic.PhysicalData;
using Model.Manager;
using Model.Manager.DataBase;
using SystmicFunction.Public.CharacterService;

namespace BML.Infrastructure.Implement
{
    /// 遍历实现接口
    /// <summary>
    ///     登录：保存到系统内部会话
    /// </summary>
    public class BaseMemberOp : BaseOperator
    {

        public MemberShip NewMemberShip(Guid id, String key, String defaultValKey, Int32 status, String userCardId)
        {
            return new MemberShip
            {
                Id = id,
                Key = key,
                DefaultValKey = defaultValKey,
                Status = status,
                UserCardId = Guid.Empty.ToString()
            };
        }


        public MemberShip CreateMemberShip(IDbContext db, String account, String key)
        {
            
            var memberShip = NewMemberShip(Guid.NewGuid(), "", key, OpertorStatusCode.UnLock, "");
            Create(db.GetOperator<MemberShip>(), memberShip);
            return memberShip;
        }

    }
}
